package com.junjun.ssm.util;

import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;

import java.nio.charset.Charset;

public class CacheUtil {
    public final  static int MAX_TIME=20;
    public final  static int MIN_TIME=10;

    public  static BloomFilter bloomFilter;
    static {
        //布隆过滤器,,实现项目中可以在用户添加数据或修改数据的时候放入数据
        bloomFilter= BloomFilter.create(
                Funnels.stringFunnel(Charset.defaultCharset()),
                1000000,0.001);
        bloomFilter.put("25");
        bloomFilter.put("125");
        bloomFilter.put("hello");
    }

    public static void main(String[] args) {
        System.out.println(CacheUtil.bloomFilter.mightContain("25"));
    }


}
